package com.gobrs.async.test.task.condition;

import com.gobrs.async.core.TaskSupport;
import com.gobrs.async.core.anno.Task;
import com.gobrs.async.core.task.AsyncTask;

@Task
public class EServiceCondition extends AsyncTask<Object, Boolean> {

    int i = 10000;

    @Override
    public void prepare(Object o) {}

    @Override
    public Boolean task(Object o, TaskSupport support) {
        System.out.println("EServiceCondition Begin");
        for (int i1 = 0; i1 < i; i1++) {
            i1 += i1;
        }
        System.out.println("EServiceCondition Finish");
        return true;
    }

    @Override
    public boolean necessary(Object o, TaskSupport support) {
        return true;
    }


    @Override
    public void onSuccess(TaskSupport support) {}

}